import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { permission, role } from '@/permission'

const app = createApp(App)
const pinia = createPinia()

// 确保pinia在router之前注册
app.use(pinia)
app.use(router)
app.use(ElementPlus, {
  locale: zhCn,
})

// 注册权限指令
app.directive('permission', permission)
app.directive('role', role)

app.mount('#app')


